/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 东莞呵呵
 * Date:2022-04-01
 * Time:21:02
 */
public class TestDemo {
    public static boolean isSorted(int[] arr){
        for (int i = 0; i < arr.length - 1; i++) {
            if (arr[i] > arr[i + 1]) {
                return false;
            }
        }
        return true;
    }
    public static void main(String[] args) {
        int[] arr = {1, 3, 5, 10, 9, 11, 13, 15};
        boolean ret = isSorted(arr);
        if (ret == true) {
            System.out.println("有序");
        } else {
            System.out.println("无序");
        }
    }
}
